<?php
namespace fastphp;

abstract class Facade
{
    protected static $container;

    public static function setContainer($container)
    {
        self::$container = $container;
    }

    protected static function getFacadeAccessor()
    {
        throw new \RuntimeException('Facade does not implement getFacadeAccessor method.');
    }

    public static function __callStatic($method, $args)
    {
        $instance = self::$container->get(static::getFacadeAccessor());
        return $instance->$method(...$args);
    }
}